package com.xyzwps.server.paimon.it

import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.web.server.LocalServerPort
import org.junit.jupiter.api.Assertions.*

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class MvcHelloTests(@LocalServerPort port: Int) : MvcTestBase(port) {

    @Test
    fun testHello() {
        webClient
            .get().uri("/apis/hello")
            .exchange()
            .expectStatus().isOk
            .expectBody()
            .jsonPath("$.data.message").value<String> { s -> assertEquals("Hello, world.", s) }
            .jsonPath("$.data.phone").value<String> { s -> assertEquals("14200000001", s) }
    }
}
